package com.five.years.common.utils;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * @author : liang.xu
 * @Date :2020-07-08
 */
public class NumberUtils {

	public static Integer getNumber(String content) {
		String regEx = "[^0-9]";
		Pattern p = Pattern.compile(regEx);
		Matcher m = p.matcher(content);
		String res=m.replaceAll("").trim();
		try {
			return Integer.valueOf(res);
		} catch (Exception e) {
			return 0;
		}
	}
}
